// VS_BEGIN
#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec2 aCoord;
layout (location = 2) in vec3 aNormal;

uniform mat4 u_model;

layout (std140) uniform EngineUBO
{
    mat4    u_view;
    mat4    u_project;
    vec3    u_camPos;
    vec3    u_camInfo;
};

void main() {
    vec3 worldPos = vec3(u_model * vec4(aPos, 1.0f));
    vec3 pos = aPos * distance(worldPos, u_camPos) * u_camInfo.y * 0.002f;
    gl_Position = u_project * u_view * u_model * vec4(pos, 1.0f);
}
// VS_END

// FS_BEGIN
#version 330 core

out vec4 FragColor;

uniform vec4 u_color;

void main() {
    FragColor = u_color;
    // FragColor = vec4(1.0f, 0.0f, 0.0f, 1.0f);
}
// FS_END